package mediator;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public abstract class AbstractBroadCast {
    protected List<HearAble> hearAbleList =new ArrayList<>();
    public void addHearer(HearAble hearer){
        Objects.requireNonNull(hearer);
        hearAbleList.add(hearer);
    }

    public abstract void send(Speaker speaker, String message);

    public void sendTo(Speaker speaker,HearAble hearer, String message) {
        hearer.hear(speaker,message);
    }
}
